
<div class="nav_col">

    <div class="preview">
    <div class="contain">

        <a href="#"><img height="66" border="0" width="106" alt="" src="<?=thumbnail(base_url().UPLOADS_FOLDER.PRODUCT_IMG_FOLDER.$item["image"])?>"></a>

        <p><strong><a href="#"><?=$item["title"]?></a></strong></p>

        <? foreach ($grouped_products AS $cat){ ?>
            <p><a href="#" class="more"><?=$cat["name"]?></a></p>
        <? } ?>

    </div>             
    </div>             

    <div class="buttons">                                                                                 

    <? if ($action == "view") { ?>

        <a href="<?=site_url('admin/'.$controller.'/edit/'.$item['id'])?>" class="button">edit</a>

        <? if ($item['active'] == 1){ ?>            
        <a href="<?=site_url('admin/'.$controller.'/deactivate/'.$item['id'])?>" class="button">deactivate</a>
        <? } else { ?> 
        <a href="<?=site_url('admin/'.$controller.'/activate/'.$item['id'])?>" class="button">activate</a>
        <? } ?>
        
        <a href="<?=site_url('admin/'.$controller.'/remove/'.$item['id'])?>" class="button">delete</a>

        <? if ($item['active']!=1){ ?>
            <div class="preview_inactive">This item is inactive</div>
        <? } ?>

    <? } ?>

    </div>

</div>               


<div class="item_col preview">   

    <h1><?=$item["title"]?></h1>

    <div class="sansserif">Below is a complete list of our products suitable for <?=$item["title"]?></div>

    <? foreach ($grouped_products AS $cat){ ?>

        <div class="headercontain">
            <p><?=$cat["name"]?></p>
        </div>

    <? //show products or subcategories
    if (!empty($cat["items"])) { 

        $i=1;
        foreach($cat["items"] as $product){ 
        ?>

            <? if (is_int(($i+2)/3)){ ?>
                <div class="summarycontainer">
            <? } ?> 
            
                <div class="contain<? if (is_int($i/3)) echo 'right'?>">
                <? $this->load->view('admin/previews/product_item_list', array("item" => $product))?>
                </div>                 

            <? if ( (is_int($i/3)) || ($i==count($cat["items"])) ){ ?>
                </div>
            <? } ?> 
        <? 
            $i++;
        } 
    } 
    ?>                                                        

    <? } ?>

</div>